<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
     <!-- 给当前页面域添加一段java代码，用来自动获取当前项目名，不写死,然后再通过EL表达式获取 -->
    <%
    	pageContext.setAttribute("PATH",request.getContextPath());
    
     %>
    
	
	
   	<script>
		
		<!-- 定一个提醒用户修改的方法，参数就是用户的ID -->
		function updatePhone(id){
			if(confirm("确定要修改id为"+id+"的电话吗？")){
			
				//如果确定，就访问controller层
				location.href="${PATH}/UpdatePhone.do/?id="+id;
			}
		}
		 
	</script>
	
	
  <!-- 搭建主页面显示 -->
  <div>
  	<!-- 标题行 -->
    			<h3><span class="label label-info ">无锡爱力思国际贸易有限公司</span></h3>
    	
    	<!-- 电话展示列表 -->
     <table class="table table-striped table table-hover">
       <tr>
	       <th>ID</th>
	       <th>电话</th>
	       <th>操作</th>  
		      
       </tr>
        <c:forEach items="${allPhone}" var="list">
            <tr>
           	 	<td>${list.id}</td>
           	 	<td>${list.ephone}</td>
           	 	
           	 	<td>
           	 		<div class="row">
			    		<div class="col-md-9 col-md-offset-0">
			    			<button type="button" class="btn btn-warning" onclick="updatePhone(${list.id})">
			    				<span class="glyphicon glyphicon-scissors"></span>
			    					修改
			    			</button>
	    				</div>
    				</div>
           	 	</td>
           	 </tr>
        </c:forEach>
        
     </table>
    		
    </div>		
